﻿using System;
using System.Web;
using System.Web.Security;

public partial class Logout : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        CerrarSesion();
    }

    /// <summary>
    /// Cierra la sesion.
    /// </summary>
    private void CerrarSesion()
    {
        Response.Cache.SetCacheability(HttpCacheability.NoCache);
        Response.Cache.SetAllowResponseInBrowserHistory(false);
        Session.Abandon();
        Session.RemoveAll();
        FormsAuthentication.SignOut();
        Response.Write("<script language=javascript>var wnd=window.open('','newWin','height=1,width=1,left=900,top=700,status=no,toolbar=no,menubar=no,scrollbars=no,maximize=false,resizable=1');</script>");
        Response.Write("<script language=javascript>wnd.close();</script>");
        Response.Write("<script language=javascript>window.open('Login.aspx','_parent',replace=true);</script>");
    }
}